﻿using System;
using System.Windows;

namespace Poet
{
    /// <summary>
    /// Interaction logic for AboutDialog.xaml
    /// </summary>
    public partial class AboutDialog : Window
    {
        public AboutDialog()
        {
            InitializeComponent();

            var assemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            var dt = new DateTime(2000, 1, 1).AddDays(assemblyVersion.Build).AddSeconds(assemblyVersion.Revision * 2);
            if (TimeZone.IsDaylightSavingTime(dt, TimeZone.CurrentTimeZone.GetDaylightChanges(dt.Year)))
                dt = dt.AddHours(1);

            Version.Content = "Version: " + assemblyVersion + " (alpha)";
            BuildDate.Content = "Build Date: " + dt;
        }

        private void Button1Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
    }
}
